package lms.dwr.demo.web.util;

import javax.servlet.http.HttpSession;

import lms.dwr.demo.common.Constants;
import lms.dwr.demo.model.ModelUser;

public class WebAppUtil 
{
	private static WebAppUtil instance = null;
	
	private WebAppUtil ()
	{
		
	}
	
	public static WebAppUtil getInstance()
	{
		if (instance == null)
		{
			instance = new WebAppUtil();
		}
		
		return instance;
	}
	
	public void injectEntityToSession (
	   ModelUser entity, HttpSession session)
	{
		if (session != null)
		{
			session.setAttribute(
			  Constants.DefaultUsrParamSessionHolder, entity);
		}
	}
	
}
